#include <stdio.h>

int main()
{
	int n;
	scanf("%d",&n);
	int ch[n];
	int i;
	int sum=0;
	int count=1;
	for(i=2;count<=n;i+=3)
	{
		sum+=i;
		count++;
	}
	printf("%d",sum);
	return 0;
}